/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jbase.demo.abstracts;

/**
 *
 * @author Administrator
 *  抽象类和接口测试
 */
public class AbstractTest {

}


abstract class Fruit {
    double weight;
    double volume;
    abstract String getTaste();
}

interface Pakable {
    void pack();
}

interface Divisible{
    void divisible();
}

class Apple extends Fruit implements Pakable {

    @Override
    String getTaste() {
        return "甜甜的";
    }

    @Override
    public void pack() {
        System.out.println("包装苹果");
    }
    
}

class Orange extends Fruit implements Pakable, Divisible {

    @Override
    String getTaste() {
        return "酸酸的";
    }

    @Override
    public void pack() {
        System.out.println("包装橙子");
    }

    @Override
    public void divisible() {
        System.out.println("把橙子分瓣");
    }
    
}